package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);
    /**
     * 分页
     */
    List<Role> query(QueryObject qo);
    Integer count(QueryObject qo);

    /**
     * 维护角色权限关系
     * @param roleId
     * @param permissionId
     */
    void insertRelation(@Param("roleId") Long roleId,
                   @Param("permissionId")Long permissionId);
    void deleteRelation(Long roleId);

    /**
     * 维护角色菜单关系
     * @param roleId
     * @param menuId
     */
    void insertMenuRelation(@Param("roleId") Long roleId,
                        @Param("menuId")Long menuId);
    void deleteMenuRelation(Long roleId);
    List<Long> selectByEmployeeId(Long employeeId);
    //根据员工id查询角色名称
    List<String> selectNameByEmployeeId(Long empId);
}